﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Auth_Default" %>
<%@ Register Assembly="Altairis.IdentityToolkit" Namespace="Altairis.IdentityToolkit.LiveId" TagPrefix="altairis" %>
<%@ Register Assembly="LeastPrivilege.InfoCardSelector" Namespace="LeastPrivilege.CardSpaceLibrary.UI" TagPrefix="lp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Authenticated</title>
</head>
<body>
    <form id="form1" runat="server">
    <h1>
        Authenticated
    </h1>
    <p>
        <asp:LoginName ID="LoginName1" runat="server" FormatString="You are currently authenticated as user '{0}'." />
        <br />
        <asp:LoginStatus ID="LoginStatus1" runat="server" LogoutText="logout this user" />
    </p>
    <h2>
        Windows Live IDs attached to this account
    </h2>
    <asp:GridView ID="GridViewLive" runat="server" AutoGenerateColumns="False" CssClass="grid" OnRowCommand="GridViewLive_RowCommand" Width="900px">
        <Columns>
            <asp:BoundField HeaderText="Date Assigned" DataField="DateAssigned" ItemStyle-Width="22ex" ItemStyle-CssClass="c" DataFormatString="{0:yyyy\-MM\-dd HH\:mm\:ss}" />
            <asp:BoundField HeaderText="Unique User ID" DataField="UniqueUserId" />
            <asp:TemplateField ItemStyle-Width="8ex" ItemStyle-CssClass="c">
                <ItemTemplate>
                    <asp:LinkButton ID="RemoveLinkButton" runat="server" Text="remove" CommandName="RemoveLive" CommandArgument='<%#Eval("UniqueUserId")%>' />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <altairis:LiveLogin ID="LiveLogin1" runat="server" Action="Login" Mode="Custom" LoginText="attach new Live ID" />
    <h2>
        Personal information cards attached to this account
    </h2>
    <asp:GridView ID="GridViewCard" runat="server" AutoGenerateColumns="False" CssClass="grid" OnRowCommand="GridViewCard_RowCommand" Width="900px">
        <Columns>
            <asp:BoundField HeaderText="Date Assigned" DataField="DateAssigned" ItemStyle-Width="22ex" ItemStyle-CssClass="c" DataFormatString="{0:yyyy\-MM\-dd HH\:mm\:ss}" />
            <asp:BoundField HeaderText="SSID" DataField="SSID" ItemStyle-Width="18ex" ItemStyle-CssClass="c" />
            <asp:BoundField HeaderText="Private Personal Identifier" DataField="PPID" />
            <asp:TemplateField ItemStyle-Width="8ex" ItemStyle-CssClass="c">
                <ItemTemplate>
                    <asp:LinkButton ID="RemoveLinkButton" runat="server" Text="remove" CommandName="RemoveCard" CommandArgument='<%#Eval("PPID")%>' />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    
    <lp:InfoCardSelector ID="InfoCardSelector1" runat="server" StandardImageSize="Size71x50" AutoDecryptToken="True" AutoPostback="True" OnTokenSubmitted="InfoCardSelector1_TokenSubmitted" RequireSsl="false">
        <lp:ClaimType IsOptional="False" Name="PPID" Type="Standard" />
    </lp:InfoCardSelector><br />
    (click the logo above to attach personal card)
    </form>
</body>
</html>
